import requests

from common.db_util import DBUtil
from common.get_header import get_header
from config import URL


class YYdeletduser(object):
    url = URL + 'user/'
    header = get_header()

    @classmethod
    def yy_delete_user(cls, data):
        resp = requests.delete(url=cls.url + data, headers=cls.header)
        return resp


if __name__ == '__main__':
    res1 = DBUtil.select_one("select user_id from sys_user where user_name = 'chen'")
    print(res1)
    data = ''
    for i in res1:
        user_id = i
        data = str(user_id)
    res = YYdeletduser.yy_delete_user(data)
    print(res.json())
